// 配置路由的地方
import Vue from 'vue'
import VueRouter from 'vue-router'
// 引入路由组件
import HomeView from '@/views/Home/home.vue'
// 使用插件
Vue.use(VueRouter)
    // 配置路由
const routes = [{
        path: '/',
        name: 'home',
        component: HomeView,
        meta: { show: true }
    },
    {
        path: '/login',
        name: 'Login',
        // 引入路由组件
        component: () =>
            import ( /* webpackChunkName: "about" */ '../views/Login/login.vue'),
        meta: { show: false }
    },
    {
        path: '/register',
        name: 'Register',
        // 引入路由组件
        component: () =>
            import ( /* webpackChunkName: "about" */ '../views/Register/register.vue'),
        meta: { show: false }
    },
    {
        path: '/search/:keyword?',
        name: 'Search',
        component: () =>
            import ( /* webpackChunkName: "about" */ '../views/Search/search.vue'),
        meta: { show: true }
    }
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router